package ModelLayer;
import java.util.ArrayList;


/**
 * Handles the DVD object
 * 
 * @author Tue Brodersen
 * @version 1.0 (2013-11-07)
 */
public class Dvd
{
    private static long dvdId = 0;
    private long id;
    private String title;
    private String genre;
    private String director;
    private String year;
    private ArrayList<DvdSpecimen> specimenList;
    

    /**
     * Constructor for objects of class Dvd
     */
    public Dvd(String title, String genre, String director, String year)
    {
        dvdId++;
        id = dvdId;
        specimenList = new ArrayList<DvdSpecimen>();
        this.title = title;
        this.genre = genre;
        this.director = director;
        this.year = year;
    }
    
    /**
     * A method to get the DVD id
     * 
     * @return Returns the ID of type long
     */
    public long getId()
    {
        return id;
    }
    
    /**
     * A method to get the title
     * 
     * @return Returns the title of type string
     */
    public String getTitle()
    {
        return title;
    }
    /**
     * A method to set the title
     * 
     * @param title Sets a new title
     */
    public void setTitle(String title)
    {
        this.title = title;
    }
    
    /**
     * A method to get the genre
     * 
     * @return Returns the genre of type string
     */
    public String getGenre()
    {
        return genre;
    }
    
    /**
     * A method to set the genre
     * 
     * @param genre Sets a new genre
     */
    public void setGenre(String genre)
    {
        this.genre = genre;
    }
    
    /**
     * A method to get the director
     * 
     * @return Returns the directe of type String 
     */
    public String getDirector()
    {
        return director;
    }
    
    /**
     * A method to set the director
     * 
     * @param director Sets a new director
     */
    
    public void setDirector(String director)
    {
        this.director = director;
    }
    
    /**
     * A method to get the year
     * 
     * @return Returns the year of type integer
     */
    public String getYear()
    {
        return year;
    }
    
    /**
     * A method to set the year
     * 
     * @param year Sets the year
     */
    public void setYear(String year)
    {
        this.year = year;
    }
    
    /**
     * A method to add a specimen to the specimenList ArrayList
     * 
     * @param specimen Adds a specimen to the ArrayList
     */
    public void addSpecimen(DvdSpecimen specimen)
    {
        specimenList.add(specimen);
    }
    
    /**
     * Returns the specimenList ArrayList
     * 
     * @return the ArrayList specimenList
     */
    public ArrayList specimens()
    {
        return specimenList;
    }
    
    /**
     * Retuns a DvdSpecimen object
     * @param index the index 
     * @return A DvdSpecimen object
     */
    public DvdSpecimen getSpecimen(int index)
    {
        return specimenList.get(index);
    }
}
